home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / sound.696 < prev    next >
Text File  |  1992-02-06  |  3KB  |  41 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fswiss Helvetica;}
  2. \paperw11760
  3. \paperh7200
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs28 Partials freqRatios inharmonic\
  8. \
  9. Q:  The Music Kit's Partials class has a variable called freqRatios, which is an array of doubles.  But the class description makes it sound as though these should be assigned integral values (like 1.0, 2.0,  3.0, etc.) .  Can you assign them fractional values like 1.3, in order to synthesize sounds with inharmonic spectra? \
  10. \
  11. A:  
  12. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 The Partials object will accept non-integer values for the freqRatios array.  However, 
  13. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 the values are floored (changed to integers) 
  14. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 when the data is converted to sound samples
  15. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 . 
  16. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0  (
  17. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 T
  18. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 his 
  19. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 conversion 
  20. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 is done for you by the 
  21. \b fillTableLength:scale:
  22. \b0  method when the Partials object is used by 
  23. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 one of the wavetable
  24. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0  Synthpatch
  25. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 es
  26. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 ).  Thus, for the most common use of the Partials object, you cannot get inharmonic partials.\
  27. \
  28. If you just want an inharmonic timbre and aren't concerned with the exact ratios, you can easily get one by using one of the FM SynthPatches, and setting its carrier/modulation ratio to be a non-integer.  The easiest way to experiment is by playing in real time with the FM parameters in the Ensemble or BreakApp demos.\
  29. \
  30. The reason that the freqRatios array is a double is to support true additive synthesis. In this case, the Partials object is not converted to a wavetable for use as the lookup table of a single oscillator.  Rather, the freqRatio, ampRatio, and phases arrays are accessed by the SynthPatch and used to determine the frequencies, amplitudes, and phases of a set of sine-wave oscillators.  Additive synthesis is more "expensive," in that it uses many more oscillators per note (one for each partial), so you can't get as many simultaneous notes.  The Music Kit doesn't currently provide such a SynthPatch, but one has been written and will soon be made available, probably on the archive servers.   \
  31.  \
  32. Also note that there's a bug with scaling in 2.0. If you ask a Partials object for a scaling of anything other than 0.0 (normalization), your samples will be N times too small, where N*2 is the length of the wavetable.\
  33. \
  34.  
  35. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 QA696\
  36. \
  37. Valid for 1.0\
  38. Valid for 2.0\
  39. \
  40.  
  41.